\title{Brainfuck---A Formal Semantics}
\maketitle

\begin{latexComment}
\section*{Abstract}
\par{This is a formal semantics for the turing complete language ``brainfuck''.  Brainfuck was designed by Urban M\"uller in 1993.  More information can be found at \url{http://en.wikipedia.org/wiki/Brainfuck}.}  Some comments below are adapted from the Wikipedia article.
	
\par{\K formal semantics for BF written by Chucky Ellison (\href{mailto:celliso2@illinois.edu}{celliso2@illinois.edu}).  It is written in the ``fully labeled'' style.}
\end{latexComment}

\begin{latexComment}
BF has eight commands: ``\texttt{+}'', ``\texttt{-}'', ``\texttt{>}'', ``\texttt{<}'', ``\texttt{[}'', ``\texttt{]}'', ``\texttt{.}'', and ``\texttt{,}''.  All other characters are treated as comments.  Below is a commented ``Hello World!'' program:

\begin{lstlisting}[
	tabsize=2,
	columns=flexible,
	basicstyle=\ttfamily,
]
+++++ +++++                    initialize counter (cell #0) to 10
[                              use loop to set the next four cells to 70/100/30/10
    > +++++ ++                 add  7 to cell #1
    > +++++ +++++              add 10 to cell #2 
    > +++                      add  3 to cell #3
    > +                        add  1 to cell #4
    <<<< -                     decrement counter (cell #0)
]                   
> ++ .                         print 'H'
> + .                          print 'e'
+++++ ++ .                     print 'l'
.                              print 'l'
+++ .                          print 'o'
> ++ .                         print ' '
<< +++++ +++++ +++++ .         print 'W'
> .                            print 'o'
+++ .                          print 'r'
----- - .                      print 'l'
----- --- .                    print 'd'
> + .                          print '!'
> .                            print '\n'
\end{lstlisting}
\end{latexComment}